<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.mytrip.model.News" import="java.util.*" import="java.text.SimpleDateFormat" import="com.mytrip.util.PageInfo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>出发吧</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="/common/include_js.jsp" />
<link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/front/css/css.css" />
</head>
<body>
<div id="wrap">
  <jsp:include page="include/top.jsp">
  	<jsp:param name="t" value="1" />
  </jsp:include>

  <div id="main">
    <div id="main_left">
      <table style="width:100%;margin-top:20px;" cellpadding="0" cellspacing="0">
    <%
    	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    	PageInfo<News> pageInfo = (PageInfo<News>)request.getAttribute("page");
    	List<News> dataList = pageInfo.getDataList();
    	
    	for(News news : dataList){
    		Integer id = news.getId();
      		String title = news.getTitle();
      		String publishTimeStr = sdf.format(news.getPublishTime());
    %>
    	<tr>
    		<td><a href="<%=request.getContextPath() %>/front/news!detail.action?id=<%=id%>"><%=title%></a></td>
    		<td style="width:100px;"><%=publishTimeStr%></td>
      	<tr>
    <%
    	}
    %>
      	<tr>
       	  <td colspan="2">
       		<%=pageInfo.getHtml()%>
       	  </td>
        </tr>
      </table>
    </div>
    
    <jsp:include page="include/main-right.jsp" />
  </div>
  
  <jsp:include page="include/bottom.jsp" />
</div>
</body>
</html>